const { getorderservice, productservice, setstatus } = require('../../service/shopper/order')
module.exports = {
    async getorder(ctx, next) {
        const { shoperid } = ctx.request.body
        const prodctid = await productservice({ shoperid })
        const id = prodctid.map(item => item.id)
        const rudata = await getorderservice({ productid: id, status: 1 })
        ctx.body = {
            code: 200,
            msg: '成功',
            data: rudata
        }
    },
    async setorder(ctx, next) {
        const { id, status } = ctx.request.body
        const rudata = await setstatus({ id }, { shoperstatus: status })
        ctx.body = {
            code: 200,
            msg: '成功',
        }
    }
}